home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: Michael Smith <msmith@mpx.com.au>
- Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
- Subject: Re: C coding problem
- Date: 6 Apr 1996 09:01:50 -0600
- Organization: Emmenjay Consulting
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4k610u$al9@solutions.solon.com>
- References: <4ianbf$h86@solutions.solon.com> <4iemcl$a05@solutions.solon.com> <4io1io$no4@solutions.solon.com> <4j41ru$nq4@solutions.solon.com> <4jttlq$3p1@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Mailer: Mozilla 2.0 (Win95; I; 16bit)
-
- Niall Smart wrote:
- > or either of:
- >
- > while (p < end_p)
- > {
- > (*p)++;
- > p++;
- > }
- >
- > while (p++ < end_p)
- > {
- > (*p)++;
- > }
- > I don't think that the last example is correct.
- While the comparison of p and end_p will occur before the incrementing of
- p, the expression (*p)++ will be evaluated AFTER p ha been incremented (I
- think???). This is not the same as the earlier examples.
-
-
-
- --
- #####################################################################
- Michael Smith msmith@mpx.com.au
- Emmenjay Consulting http://www.hutch.com.au/~emmenjay
- #####################################################################
-